This paper presents a novel method to calculate the REFERENCE source CURRENT and the REFERENCE compensating CURRENT for shunt active power filters (SAPFs). This method first calculates the amplitude and phase of the fundamental load CURRENT from a recursive algebraic approach block before calculating the displacement power factor. Next, the amplitude of the REFERENCE mains CURRENT is computed with the corresponding phase voltage. Finally, the difference between the actual load CURRENT and the REFERENCE source CURRENT is considered the REFERENCE compensating CURRENT to be delivered by the SAPF. The proposed method is presented and applied to the control system of the voltage source converter of SAPFs. The performance of the proposed method in reducing harmonics and improving the power factor is examined with a SAPF simulation model. The results are compared with the instantaneous active and reactive p-q power theory as other REFERENCE generation method.